package com.wngz.controller;

import com.wngz.entity.Book;
import com.wngz.service.IBookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author yellow Docter
 * @date 2024-09-28
 * @desc 蜗牛创想：www.woniuxy.com
 */
@RestController
@RequestMapping("book")
public class BookController {

    @Autowired
    private IBookService bookService;

    @GetMapping("/list")
    public List<Book> selectBooks(){
        List<Book>  books = bookService.listBooks();
        return books;
    }
}
